﻿<src:IWpfConfiguration x:Class="VisionModules.Wpf.PictureConfig"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:src="clr-namespace:MayhemDefaultStyles.UserControls;assembly=MayhemDefaultStyles"
             DataContext="{Binding RelativeSource={RelativeSource Self}}"  
             Name="root"
             Width="400">

    <Grid  IsVisibleChanged="root_IsVisibleChanged">
        <StackPanel>
            <!--<Canvas Width="320" Height="240" Name="camera_preview" />-->
            <!-- arrange camera previews in 3x2 grid -->
            <!--<WrapPanel Bin Name="camera_preview_panel" d Width="400" Height="200" ItemWidth="133" ItemHeight="99"></WrapPanel>
            -->

            <ItemsControl  BorderThickness="0" Name="camera_preview_panel" Width="400" Height="200" ItemsSource="{Binding ElementName=root, Path=camera_previews}">
                <ItemsControl.ItemsPanel>
                    <ItemsPanelTemplate>
                        <WrapPanel  Name="camera_preview_panel_itemsPanel"  IsItemsHost="True" Width="400" Height="200" ItemWidth="133" ItemHeight="99"></WrapPanel>
                    </ItemsPanelTemplate>
                </ItemsControl.ItemsPanel>
                <ItemsControl.ItemTemplate>
                    <DataTemplate>
                        <Border  Background="{Binding}" Padding="0" x:Name="bborder" Width="133" Height="99" BorderThickness="2" BorderBrush="Transparent" Cursor="Hand" MouseLeftButtonUp="bborder_MouseLeftButtonUp" Loaded="bborder_Loaded" Unloaded="bborder_Unloaded">    
                        </Border>
                    </DataTemplate>
                </ItemsControl.ItemTemplate>
            </ItemsControl>
          

            <TextBlock Margin="5 0 5 0" TextWrapping="Wrap"  Height="47" Width="390">Click drop down list below to select a camera or click one of the preview images above.</TextBlock>
            <ComboBox Name="deviceList" SelectionChanged="deviceList_SelectionChanged" />
            <Label>Select the time offset in seconds of the image to be taken:</Label>
            <StackPanel Orientation="Vertical">
                <Slider Name="slider_capture_offset" Height="23"  Width="220" Value="{Binding ElementName=root, Path=slider_value}" ValueChanged="slider_capture_offset_ValueChanged" />
            </StackPanel>
            <Label Name="img_save_label">Click button below to choose location of saved images:</Label>
            <Button Name="img_save_button" Click="Button_Click_1">Save Images Location</Button>
            
        </StackPanel>
    </Grid>
</src:IWpfConfiguration>